package com.lanhai.javaBean;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import com.mybatis.dao.ParamDao;

public class ParamBean {

	/**
	 * 加载系统参数
	 */
	public static List<Map<String, String>> loadData(SqlSessionFactory sqlSessionFactory, String PCName){
		List<Map<String, String>> paramList = new ArrayList<Map<String, String>>();
		SqlSession sqlSession = sqlSessionFactory.openSession();
		try {
			ParamDao paramDao = sqlSession.getMapper(ParamDao.class);
			paramList = paramDao.selectParamByPC(PCName);
	    }catch(Exception e){
	    	e.printStackTrace();
	    }finally{
	    	sqlSession.close();
	    }
		return paramList;
	}
	
}
